import sun.misc.PostVMInitHook;

import java.util.Scanner;

public class test {
                           //实现阶乘运算的相加
                           // 5！+4！+3！+2！+1！
    public static void main(String[] args) {
        int i = 1;
        int j = 1;
        int sum = 1;
        int result = 0;
        while(j<=5) {

            while (i <= j) {
                sum = sum * i;
                i++;
            }
            result+=sum;
            j++;
        }
            System.out.println(result);
        }



                           //创建一个中间变量交换
    public static void main3(String[] args) {
        int a = 10;
        int b = 20;
        int tem =0;
        tem=b;
        b=a;
        a=tem;
        System.out.println(a);
        System.out.println(b);
    }


                     //闰年的判断
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int year = scanner.nextInt();
        if(year%4 == 0 && year/100 != 0) {
            System.out.println("闰年");
        }else{
            System.out.println("不是");
        }
    }


    public static void main1(String[] args) {
        Scanner scanner = new Scanner(System.in);//相当于C语言中的scanf
        //String str = scanner.nextLine();//输入一个字符串
        //System.out.println(str);
        int num = scanner.nextInt();
        if(num%2 == 0) {
            System.out.println("偶数");
        }else{
            System.out.println("奇数");
        }
    }
}
